from fastapi import FastAPI

app = FastAPI()


# http://58.34.49.226:53021/weather?city=%E4%B8%8A%E6%B5%B7
# 获取天气信息的接口
@app.get("/weather")
def get_weather(city: str):
    return f"{city}天气晴，27度"


# 启动应用
if __name__ == '__main__':
    import uvicorn

    uvicorn.run(app, host="0.0.0.0", port=50001)
